import config from './config.js';

export default function (url, data={}, method="GET") {
  return new Promise((resolve,reject) => {
    // 发送请求,是同步发送,异步接收
    wx.request({
      url: config.mpHost + url,
      data,
      method,
      success: (res) => {
        resolve(res.data)
      }
    })
  })
}